home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 February / PCWorld_2000-02_cd.bin / Software / Vyzkuste / xsetup / _SETUP.2 / Group3 / XQ Win2k Control Panel 1.xpl < prev    next >
Text File  |  1999-09-03  |  2KB  |  95 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 5.0"
  2. "TYPE"="8"
  3. "COUNT"="2"
  4. "TEXT 1"="Edit Path..."
  5. "TEXT 2"="Delete"
  6. "UIPATH"="Appearance\Control Panel\Windows 2000 Icons"
  7. "NAME"="Visible Items (User)"
  8. "VERSION"="0.90"
  9. "LANGUAGE"="VBScript"
  10. "DESCRIPTION 1"=""
  11. "DESCRIPTION 2"=""
  12. "DESCRIPTION 3"=""
  13. "AUTHOR"="Xteq Systems"
  14. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  15. "COMMENT 1"="For more information, go to http://www.xteq.com or write to TeXHeX@xteq.com."
  16.  
  17.  
  18. '*** ORIGINAL ***'
  19. sP="HKCU\Software\Microsoft\Windows\CurrentVersion\Control Panel\cpls\"
  20. '"HKLM\Software\Microsoft\Windows\CurrentVersion\Control Panel\cpls\"
  21.  
  22. Sub Plugin_Initialize 
  23.  if GetWinVer=4 then
  24.   iCount=RegEnumValues(sP)
  25.  
  26.   for l=1 to iCount
  27.     s=sP & RegEnumElement(l) 
  28.     s2=RegReadValue(s)
  29.     s3=RegEnumElement(l) & " (" & s2 & ")" 
  30.  
  31.     Call SetUIElement(l,s3)
  32.   next
  33.  else
  34.   Disable
  35.  end if
  36.  
  37. End Sub
  38.  
  39. Sub Plugin_CheckData(ElementIndex)
  40. End Sub
  41.  
  42. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  43.  if ElementSubIndex>0 then 'OK, user has selected an item
  44.  
  45.     If ElementIndex=1 then 
  46.        'Rename file
  47.  
  48.        s=sP & RegEnumElement(ElementSubIndex)
  49.        sV=RegReadValue(s) 
  50.  
  51.        sV=InputWindow("Change path",sV,1)
  52.  
  53.        if IsEmpty(sV)=false then
  54.           'change it (write REG_EXPAND_SZ)
  55.           Call RegWriteValue(s,sV,4)
  56.           
  57.           'update UI
  58.           s=RegEnumElement(ElementSubIndex) & " (" & sV & ")"
  59.           Call SetUIElement(ElementSubIndex,s)
  60.        end if 
  61.  
  62.     else 
  63.        'Delete!!
  64.  
  65.        s=""
  66.        sV=InputWindow("Enter YES to delete this item",s,1)
  67.        
  68.        bOK=false 
  69.        if IsEmpty(sV)=false then
  70.           if sV="YES" then
  71.              bOK=true
  72.              s=sP & RegEnumElement(ElementSubIndex)
  73.              Call RegDeleteValue(s) 
  74.              Call SetUIElement(ElementSubIndex,"")
  75.           end if 
  76.        end if
  77.  
  78.        if bOK=false then
  79.           Call MsgWarning("Items was not deleted") 
  80.        end if
  81.        
  82.     end if
  83.  
  84.  
  85.  else
  86.   Call MsgWarning("No item selected - please select an item first.")
  87.  end if
  88. End Sub
  89.  
  90. Sub Plugin_Terminate 
  91. End Sub
  92.  
  93.  
  94.  
  95.